// enum 枚举
// 理解一系列常亮集合
// 比如三原色，周一到周日，四个方位
// 1.数字枚举
// 没赋值，默认0起步，依次递增
var Direction;
(function (Direction) {
    Direction[Direction["Up"] = 0] = "Up";
    Direction[Direction["Down"] = 1] = "Down";
    Direction[Direction["Left"] = 2] = "Left";
    Direction[Direction["Right"] = 3] = "Right";
})(Direction || (Direction = {}));
console.log(Direction.Up);
console.log(Direction[0]);
// 手动赋值，10开始起步，依次递增
var DirectionOne;
(function (DirectionOne) {
    DirectionOne[DirectionOne["Up"] = 10] = "Up";
    DirectionOne[DirectionOne["Down"] = 11] = "Down";
    DirectionOne[DirectionOne["Left"] = 12] = "Left";
    DirectionOne[DirectionOne["Right"] = 13] = "Right";
})(DirectionOne || (DirectionOne = {}));
console.log(DirectionOne.Right); // 13
// 2.字符串枚举
var DirectionStr;
(function (DirectionStr) {
    DirectionStr["Up"] = "UP";
    DirectionStr["Down"] = "DOWN";
    DirectionStr["Left"] = "LEFT";
    DirectionStr["Right"] = "RIGHT";
})(DirectionStr || (DirectionStr = {}));
// enum基本用法
var value = 'UP';
if (value === DirectionStr.Up) {
    console.log("go up!");
}
var valueTwo = 'DOWN';
if (valueTwo === "DOWN" /* DirectionStrConst.Down */) {
    console.log("go Down!");
}
